import {BasicColumn, FormSchema} from '@/components/table';
import {render} from "@/hooks/render/renderUtils";
import {RenderType} from '@pkg/setting';

export const columns: BasicColumn[] = [
  {
    title: '头像',
    dataIndex: 'avatar',
    width: 200,
    customRender: render.renderAvatar
  },
  {
    title: '反馈人',
    dataIndex: 'nickName',
    width: 200,
  },
  {
    title: '手机号',
    dataIndex: 'mobile',
    width: 200,
  },
  {
    title: '反馈内容',
    dataIndex: 'feedContent',
    width: 200,
    customRender: render.renderTip
  },
  {
    title: '图片',
    dataIndex: 'feedImages',
    width: 200,
    customRender: render.renderImage
  },
  {
    title: '状态',
    dataIndex: 'feedState',
    width: 200,
    dictData: [
      {label: '未回复', value: 0},
      {label: '已回复', value: 1},
    ],
    renderType: RenderType.DICT,
  },
  {
    title: '反馈时间',
    dataIndex: 'createTime',
    width: 200,
  }
];

export const searchFormSchema: FormSchema[] = [];

export const formSchema: FormSchema[] = [
  {
    label: '反馈内容',
    field: 'feedContent',
    component: 'InputTextArea',
    required: true,
  },
  {
    label: '图片',
    field: 'feedImages',
    component: 'ImageUpload'
  },
  {
    label: '回复内容',
    field: 'replyContent',
    component: 'InputTextArea'
  }
];
